<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>C++ Web Framework: Variant Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">C++ Web Framework
   &#160;<span id="projectnumber">3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-slots">Public Slots</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_variant-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Variant Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>This class is designed to facilitate the passing of simple type parameters such as qlonglong, double, int, and QString to the CSTL (C++ Server Pages Standard Tags Library).  
 <a href="class_variant.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="variant_8h_source.html">variant.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Variant:</div>
<div class="dyncontent">
<div class="center"><img src="class_variant__inherit__graph.png" border="0" usemap="#_variant_inherit__map" alt="Inheritance graph"/></div>
<!-- MAP 0 -->
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr class="memitem:a832bfdf3d791497b776c67b322fec871"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a832bfdf3d791497b776c67b322fec871">toInt</a> (bool *ok=nullptr) const noexcept</td></tr>
<tr class="memdesc:a832bfdf3d791497b776c67b322fec871"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the variant as an int if the variant has userType() QMetaType::Int, QMetaType::Bool, QMetaType::QByteArray, QMetaType::QChar, QMetaType::Double, QMetaType::LongLong, QMetaType::QString, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns 0.  <a href="#a832bfdf3d791497b776c67b322fec871">More...</a><br /></td></tr>
<tr class="separator:a832bfdf3d791497b776c67b322fec871"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1797f20d9396d3ddaf24b16453e3534"><td class="memItemLeft" align="right" valign="top"><a id="ad1797f20d9396d3ddaf24b16453e3534"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#ad1797f20d9396d3ddaf24b16453e3534">setInt</a> (int value) noexcept</td></tr>
<tr class="memdesc:ad1797f20d9396d3ddaf24b16453e3534"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an int value. <br /></td></tr>
<tr class="separator:ad1797f20d9396d3ddaf24b16453e3534"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17e4fd1648eb98fdc0a68302c392a216"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a17e4fd1648eb98fdc0a68302c392a216">toDouble</a> (bool *ok=nullptr) const noexcept</td></tr>
<tr class="memdesc:a17e4fd1648eb98fdc0a68302c392a216"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the variant as a double if the variant has userType() QMetaType::Double, QMetaType::Float, QMetaType::Bool, QMetaType::QByteArray, QMetaType::Int, QMetaType::LongLong, QMetaType::QString, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns 0.0.  <a href="#a17e4fd1648eb98fdc0a68302c392a216">More...</a><br /></td></tr>
<tr class="separator:a17e4fd1648eb98fdc0a68302c392a216"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6af0bb75e0612a13cb0880f0cec9a870"><td class="memItemLeft" align="right" valign="top"><a id="a6af0bb75e0612a13cb0880f0cec9a870"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a6af0bb75e0612a13cb0880f0cec9a870">setDouble</a> (double value) noexcept</td></tr>
<tr class="memdesc:a6af0bb75e0612a13cb0880f0cec9a870"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an double value. <br /></td></tr>
<tr class="separator:a6af0bb75e0612a13cb0880f0cec9a870"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4181b7ff9d27ae4936a6e91c9a9d7e26"><td class="memItemLeft" align="right" valign="top">qlonglong&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a4181b7ff9d27ae4936a6e91c9a9d7e26">toLongLong</a> (bool *ok=nullptr) const noexcept</td></tr>
<tr class="memdesc:a4181b7ff9d27ae4936a6e91c9a9d7e26"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the variant as a long long int if the variant has userType() QMetaType::LongLong, QMetaType::Bool, QMetaType::QByteArray, QMetaType::QChar, QMetaType::Double, QMetaType::Int, QMetaType::QString, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns 0.  <a href="#a4181b7ff9d27ae4936a6e91c9a9d7e26">More...</a><br /></td></tr>
<tr class="separator:a4181b7ff9d27ae4936a6e91c9a9d7e26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a415098d546cf5f269de7ef5c5c438304"><td class="memItemLeft" align="right" valign="top"><a id="a415098d546cf5f269de7ef5c5c438304"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a415098d546cf5f269de7ef5c5c438304">setLongLong</a> (qlonglong value) noexcept</td></tr>
<tr class="memdesc:a415098d546cf5f269de7ef5c5c438304"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an qlonglong value. <br /></td></tr>
<tr class="separator:a415098d546cf5f269de7ef5c5c438304"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40530eedbdc0f3bad04df67febbc09de"><td class="memItemLeft" align="right" valign="top"><a id="a40530eedbdc0f3bad04df67febbc09de"></a>
QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a40530eedbdc0f3bad04df67febbc09de">toString</a> () const noexcept</td></tr>
<tr class="memdesc:a40530eedbdc0f3bad04df67febbc09de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the variant as a QString if the variant has userType() QMetaType::QString, QMetaType::Bool, QMetaType::QByteArray, QMetaType::QChar, QMetaType::QDate, QMetaType::QDateTime, QMetaType::Double, QMetaType::Int, QMetaType::LongLong, QMetaType::QStringList, QMetaType::QTime, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns an empty string. <br /></td></tr>
<tr class="separator:a40530eedbdc0f3bad04df67febbc09de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ca6fc641562de93db2490eb2a1e7d0e"><td class="memItemLeft" align="right" valign="top"><a id="a0ca6fc641562de93db2490eb2a1e7d0e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a0ca6fc641562de93db2490eb2a1e7d0e">setString</a> (const QString &amp;value) noexcept</td></tr>
<tr class="memdesc:a0ca6fc641562de93db2490eb2a1e7d0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an QString value. <br /></td></tr>
<tr class="separator:a0ca6fc641562de93db2490eb2a1e7d0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a594b84b7c7a7e997aac3354bbdaa2d97"><td class="memItemLeft" align="right" valign="top"><a id="a594b84b7c7a7e997aac3354bbdaa2d97"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a594b84b7c7a7e997aac3354bbdaa2d97">Variant</a> ()=default</td></tr>
<tr class="memdesc:a594b84b7c7a7e997aac3354bbdaa2d97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs an invalid variant. <br /></td></tr>
<tr class="separator:a594b84b7c7a7e997aac3354bbdaa2d97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1015564e64eb9bc9ce894fb1f98b6e36"><td class="memItemLeft" align="right" valign="top"><a id="a1015564e64eb9bc9ce894fb1f98b6e36"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a1015564e64eb9bc9ce894fb1f98b6e36">Variant</a> (int value)</td></tr>
<tr class="memdesc:a1015564e64eb9bc9ce894fb1f98b6e36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an integer value. <br /></td></tr>
<tr class="separator:a1015564e64eb9bc9ce894fb1f98b6e36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e7d9a46e166e059ce75b76b92b11457"><td class="memItemLeft" align="right" valign="top"><a id="a7e7d9a46e166e059ce75b76b92b11457"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a7e7d9a46e166e059ce75b76b92b11457">Variant</a> (double value)</td></tr>
<tr class="memdesc:a7e7d9a46e166e059ce75b76b92b11457"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an double value. <br /></td></tr>
<tr class="separator:a7e7d9a46e166e059ce75b76b92b11457"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f86cea152e761f48700e41f210fe251"><td class="memItemLeft" align="right" valign="top"><a id="a6f86cea152e761f48700e41f210fe251"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a6f86cea152e761f48700e41f210fe251">Variant</a> (qlonglong value)</td></tr>
<tr class="memdesc:a6f86cea152e761f48700e41f210fe251"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an qlonglong value. <br /></td></tr>
<tr class="separator:a6f86cea152e761f48700e41f210fe251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a2d8b7cc035142a795f86d481adde0c"><td class="memItemLeft" align="right" valign="top"><a id="a2a2d8b7cc035142a795f86d481adde0c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#a2a2d8b7cc035142a795f86d481adde0c">Variant</a> (const QString &amp;value)</td></tr>
<tr class="memdesc:a2a2d8b7cc035142a795f86d481adde0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant with an QString value. <br /></td></tr>
<tr class="separator:a2a2d8b7cc035142a795f86d481adde0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af11a005d444e0879b6a479bca786b19e"><td class="memItemLeft" align="right" valign="top"><a id="af11a005d444e0879b6a479bca786b19e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_variant.html#af11a005d444e0879b6a479bca786b19e">Variant</a> (const QByteArray &amp;value)</td></tr>
<tr class="memdesc:af11a005d444e0879b6a479bca786b19e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new variant and converts to QString. <br /></td></tr>
<tr class="separator:af11a005d444e0879b6a479bca786b19e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is designed to facilitate the passing of simple type parameters such as qlonglong, double, int, and QString to the CSTL (C++ Server Pages Standard Tags Library). </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a17e4fd1648eb98fdc0a68302c392a216"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17e4fd1648eb98fdc0a68302c392a216">&#9670;&nbsp;</a></span>toDouble</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double Variant::toDouble </td>
          <td>(</td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>ok</em> = <code>nullptr</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">slot</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the variant as a double if the variant has userType() QMetaType::Double, QMetaType::Float, QMetaType::Bool, QMetaType::QByteArray, QMetaType::Int, QMetaType::LongLong, QMetaType::QString, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns 0.0. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">If</td><td>ok is non-null: *ok is set to true if the value could be converted to a double; otherwise *ok is set to false. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a832bfdf3d791497b776c67b322fec871"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a832bfdf3d791497b776c67b322fec871">&#9670;&nbsp;</a></span>toInt</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int Variant::toInt </td>
          <td>(</td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>ok</em> = <code>nullptr</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">slot</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the variant as an int if the variant has userType() QMetaType::Int, QMetaType::Bool, QMetaType::QByteArray, QMetaType::QChar, QMetaType::Double, QMetaType::LongLong, QMetaType::QString, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns 0. </p>
<dl class="section warning"><dt>Warning</dt><dd>: If the value is convertible to a QMetaType::LongLong but is too large to be represented in an int, the resulting arithmetic overflow will not be reflected in ok. A simple workaround is to use QString::toInt() </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">If</td><td>ok is non-null: *ok is set to true if the value could be converted to an int; otherwise *ok is set to false. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a4181b7ff9d27ae4936a6e91c9a9d7e26"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4181b7ff9d27ae4936a6e91c9a9d7e26">&#9670;&nbsp;</a></span>toLongLong</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">qlonglong Variant::toLongLong </td>
          <td>(</td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>ok</em> = <code>nullptr</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">slot</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the variant as a long long int if the variant has userType() QMetaType::LongLong, QMetaType::Bool, QMetaType::QByteArray, QMetaType::QChar, QMetaType::Double, QMetaType::Int, QMetaType::QString, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">If</td><td>ok is non-null: *ok is set to true if the value could be converted to an int; otherwise *ok is set to false. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/home/herik/CPPWebFramework/CPPWebFramework/cwf/<a class="el" href="variant_8h_source.html">variant.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon May 28 2018 11:09:09 for C++ Web Framework by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
